<?php
namespace Home\Controller;

class MentoringController extends HomeController {

    public function index(){
        $id = I('get.id',1);        
        $map['cid']=1;
        $list = M('Article')->field('id,title,url,content')->where($map)->select();
        $this->assign('list',$list);

        if ($id!='') {
            unset($map);
            $map['id']=$id;
            $one = M('Article')->where($map)->find();
        }else{
            $one = $list[0];
        }
        $this->assign('one',$one);
        $this->assign('id',$id);
    	$this->display();
    }   

    public function packages(){
        $map['show']=1;
        $map['id'] = array('gt',2);
        $list = M('Goods')->where($map)->order('sort')->select();
        $this->assign('list',$list);
        $this->display();
    }
}